/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BUS;

import DAO.Phong_DAO;
import DTO.Phong_DTO;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Lenh Ho Xung
 */
public class Phong_BUS {

    public static DefaultTableModel layDanhSachPhong() throws Exception {
        return Phong_DAO.layDanhSachPhong();
    }

    public static DefaultTableModel layDanhSachPhongTrong() throws Exception {
        return Phong_DAO.layDanhSachPhongTrong();
    }

    public static DefaultTableModel layDanhSachPhongDeThue() throws Exception {
        return Phong_DAO.laydanhsachPhongDeThue();
    }

    public static void Insert(Phong_DTO p) throws Exception {
        Phong_DAO.Insert(p);
    }

    public static void Delete(String maPhong) throws Exception {
        Phong_DAO.Delete(maPhong);
    }

    public static void Update(Phong_DTO p) throws Exception {
        Phong_DAO.Update(p);
    }

    public static void capnhattinhtrangDat(String maPhong, String ttcapNhat) throws Exception {
        Phong_DAO.capnhatTinhTrangPhong(maPhong, ttcapNhat);
    }

    public static String taoMaTuDong(String maGoc, int batDau) throws Exception {
        return Phong_DAO.taoMaTuDong(maGoc, batDau);
    }

    public static String layMaLPTheoMP(String maP) throws Exception {
        return Phong_DAO.layMaLPTheoMP(maP);
    }

    public static DefaultTableModel timPhongTheoTenLoaiPhong(String tenloaiPhong) throws Exception {
        return Phong_DAO.timPhongTheoTenLoaiPhong(tenloaiPhong);
    }


    public static DefaultTableModel timPhongTheoTinhTrang(String tinhTrang) throws Exception {
        return Phong_DAO.timPhongTheoTinhTrang(tinhTrang);
    }

//    public static String layMaLPTheoMP(String maP) throws Exception {
//       return Phong_DAO.layMaLPTheoMP(maP);
//    }
    public static DefaultTableModel timPhongTheoTLP_TT(String tinhTrang, String tenloaiPhong) throws Exception{
        return Phong_DAO.timPhongTheoTLP_TT(tinhTrang, tenloaiPhong);
    }
}
